package com.cristina.attention.config;

import com.cristina.attention.consumer.Receiver;
import com.cristina.attention.pending.ImTask;
import com.cristina.attention.pending.Task;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

/**
 * 配置信息
 *
 * @author by superman
 */
@Configuration
public class PrototypeBeanConfig {

    /**
     * 定义多实例的 Receiver
     * @return
     */
    @Bean
    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
    public Receiver receiver() {
        return new Receiver();
    }

    /**
     * 定义多实例的 Task
     * @return
     */
    @Bean
    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
    public Task task() {
        return new Task();
    }

    /**
     * 定义多实例的 ImTask
     * @return
     */
    @Bean
    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
    public ImTask imTask() {
        return new ImTask();
    }
}
